home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
c
/
cc02.zip
/
DEMO.C
< prev
next >
Wrap
Text File
|
1985-08-08
|
30KB
|
926 lines
#define foreground(A) ((color_mon==1)?(A):(7))
int u_row[14]={2,2,2,2,2,8,14,20,20,20,20,20,14,8};
int u_col[14]={6,21,36,51,66,66,66,66,51,36,21,6,6,6};
int l_row[14]={6,6,6,6,6,12,18,24,24,24,24,24,18,12};
int l_col[14]={15,30,45,60,75,75,75,75,60,45,30,15,15,15};
int wind[14];
int color_mon=0;
main()
{
int temp,key,i,j,k,l;
color(7,0);
temp=open_window(9,15,13,61);
locate(11,20);printf("Do you have a color monitor (Y/N) [ ]");
locate(11,55);
putch(key=getch());
if(key=='Y' || key=='y')color_mon=1;
close_window(temp);
color(foreground(1),0);
temp=open_window(3,5,23,75);
color_window(temp,foreground(14),0);
cls_window(temp);
print_window(temp,"╓─────────────────────────────────────────────── ▒▒▒▒█████\n");
print_window(temp,"║ ░░░░░░ ███████▄\n");
print_window(temp,"║ ██ █ ██ ░____ ████O████\n");
print_window(temp,"║ ██ ███ ██ ░ ▀▀▀▀▀▀▀▀▀\n");
print_window(temp,"║ ██ ██ I N D O W ░░░░░░ O F T │\n");
print_window(temp,"║ │\n");
print_window(temp,"╚══════════╤══════════════════════════╤════════════╛\n");
print_window(temp," │ Fast - Small - Easy & │ ╔════════════════════╗\n");
print_window(temp," │ C H E A P │ ║ Glen Boyd ║\n");
print_window(temp," ╔═════│ │═══╣ 21606 Criptana ║\n");
print_window(temp," ║ │ W I N D O W S For 'C' │ ║ Mission Viejo, CA ║\n");
print_window(temp," ║ │ │ ║ 92692 ║\n");
print_window(temp," ║ ╘══════════════════════════╛ ╚══╦═════════════════╝\n");
print_window(temp," ║ ║\n");
print_window(temp," ║ If you use these functions and find ║\n");
print_window(temp," ║ them of value, a contribution of $30 ║\n");
print_window(temp," ║ would be greatly appreciated. ║\n");
print_window(temp," ║ ║\n");
print_window(temp," ╚═══════════════════════════════════════╝");
key=getch();
close_window(temp);
for(i=0;i<=13;i++){
color(foreground(i+1),0);
wind[i]=open_window(u_row[i],u_col[i],l_row[i],l_col[i]);
}
for(i=13;i>=0;i--){
close_window(wind[i]);
}
for(i=13;i>=0;i--){
color(foreground(i+1),0);
wind[i]=open_window(u_row[i],u_col[i],l_row[i],l_col[i]);
}
for(i=0;i<=13;i++){
close_window(wind[i]);
}
for(i=0;i<14;i++){
color(foreground(i+1),0);
wind[i]=open_window(u_row[i],u_col[i],l_row[i],l_col[i]);
color_window(wind[i],foreground(13),0);
print_window(wind[i],"C-WINDOWC-WINDOWC-WINDOW");
color_window(wind[i],foreground(i+1),0);
}
subject(-1);
/* Move box 14 into place */
for(i=15;i<=35;i++){
move_window(wind[13],2);
slower();
}
close_window(wind[13]);
subject(13);
/* Move box 13 into place */
for(i=14;i>=11;i--){
move_window(wind[12],1);
slower(13);
}
for(i=15;i<=40;i++){
move_window(wind[12],2);
slower();
}
close_window(wind[12]);
subject(12);
/* Move box 12 into place */
for(i=11;i>=7;i--){
for(j=u_col[i];j>6;j--){
move_window(wind[i],4);
slower();
}
for(j=u_row[i];j>11;j--){
move_window(wind[i],1);
slower();
}
l_col[i]=11;
for(j=l_col[i];j<=35;j++){
move_window(wind[i],2);
slower();
}
close_window(wind[i]);
subject(i);
}
for(i=6;i>=4;i--){
for(j=l_row[i];j<24;j++){
move_window(wind[i],3);
slower();
}
l_row[i]=24;
for(j=u_col[i];j>6;j--){
move_window(wind[i],4);
slower();
}
for(j=l_row[i];j>15;j--){
move_window(wind[i],1);
slower();
}
l_col[i]=6;
for(j=l_col[i];j<=35;j++){
move_window(wind[i],2);
slower();
}
close_window(wind[i]);
subject(i);
}
for(i=3;i>=0;i--){
for(j=l_col[i];j<75;j++){
move_window(wind[i],2);
slower();
}
l_col[i]=75;
for(j=l_row[i];j<24;j++){
move_window(wind[i],3);
slower();
}
l_row[i]=24;
for(j=l_col[i];j>15;j--){
move_window(wind[i],4);
slower();
}
for(j=l_row[i];j>15;j--){
move_window(wind[i],1);
slower();
}
l_col[i]=11;
for(j=l_col[i];j<=35;j++){
move_window(wind[i],2);
slower();
}
close_window(wind[i]);
subject(i);
}
subject(-2);
}
subject(wind)
int wind;
{
static int temp,
temp2;
int key,
wind1,
wind2,
wind3,
wind4,i,j;
char string[100];
switch(wind){
case (-1):
color(foreground(14),0);
temp2=open_window(8,17,18,64);
color_window(temp2,foreground(2),0);
print_window(temp2," C-WINDOWS is a comprehensive screen and");
print_window(temp2,"\n window handling package. C-WINDOWS relieves");
print_window(temp2,"\n the programmer of handling extensive screen");
print_window(temp2,"\n and window manipulation. C-WINDOWS is a");
print_window(temp2,"\n library of pre-written 'C' and ASSEMBLY");
print_window(temp2,"\n functions which do printing, coloring,");
print_window(temp2,"\n cursor positioning, and window handling.");
locate_window(temp2,9,9);
print_window(temp2,"Press any key to continue...");
color_window(temp2,foreground(14),0);
key=getch();
break;
case(13):
color(foreground(14),0);
temp=open_window(4,9,23,73);
color_window(temp,foreground(2),0);
print_window(temp," C-WINDOWS is supplied in a MS-DOS object library. To obtain ");
print_window(temp,"\n the source for C-WINDOWS send a $30 contribution. \n");
print_window(temp,"\n C-WINDOWS provides you with a extensive set of pre-written ");
print_window(temp,"\n functions for manipulation of the screen. C-WINDOWS ");
print_window(temp,"\n provides functions for handling standard screen I/O such as ");
print_window(temp,"\n printing, locating the cursor, setting color, scrolling part ");
print_window(temp,"\n of the screen, printing boxes, saving and restoring parts of ");
print_window(temp,"\n the screen, and printing horizontal and veritcal bars of ");
print_window(temp,"\n characters. \n");
print_window(temp,"\n C-WINDOWS also contains a extensive set of functions for ");
print_window(temp,"\n handling windows. C-WINDOWS treats each seperate window as ");
print_window(temp,"\n a seperate virtual screen. C-WINDOWS allows you to scroll, ");
print_window(temp,"\n locate in, color, blank, print in, move, open, close and re ");
print_window(temp,"\n activate each window by only specifying the window you want \n");
locate_window(temp,18,15);
print_window(temp,"Press any key to continue...");
color_window(temp,foreground(14),0);
key=getch();
close_window(temp);
break;
case(12):
color(foreground(14),0);
temp=open_window(4,9,23,73);
color_window(temp,foreground(2),0);
print_window(temp," this to take place in. \n");
print_window(temp,"\n C-WINDOWS has a default maximum setting of 255 windows at ");
print_window(temp,"\n one time. This can be changed easily to a greater or lessor ");
print_window(temp,"\n amount by recompiling the source. C-WINDOWS treats windows ");
print_window(temp,"\n in the same manor as the Macintosh and LISA computers. You ");
print_window(temp,"\n can open windows in layers on top of each other and then ");
print_window(temp,"\n re-activate a window which is in the middle of or the ");
print_window(temp,"\n bottom. C-WINDOWS will restore any text under the windows ");
print_window(temp,"\n when they are opened, closed or re-activated.\n");
print_window(temp,"\n To use the C-WINDOWS functions, all you have to do is put ");
print_window(temp,"\n the code in your program which make